﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WCS.Entities;
using WCS.Entities.Enum;

namespace Warehouse.Entites
{
    //物料
    public class Material
    {
        //IsIdentity = true
        [SugarColumn(IsPrimaryKey = true)]
        public string Id { get; set; }
        //托盘号
        public string Palletnumber { get; set; }
        //物料编号
        [SugarColumn(IsNullable = true)]
        public string MaterialNumber { get; set; }
        //物料名称
        public string MaterialName { get; set; }
        //物料效率
        public string? Specification { get; set; }
        //开压
        public string? Voltage { get; set; }
        //颜色
        public string? Color { get; set; }
        //等级
        public string? Grade { get; set; }
        ////简介
        //[SugarColumn(IsIgnore =true)]
        //public string Remark { get; set; }

        //总数量
        public int Number { get; set; }
        //箱数
        //public string? Count { get; set; }
        ////母托的托盘号
        //public string? Strenumbell { get; set; }

        /// <summary>
        ///  库位Id
        ///  描述：
        ///     对应库位Id
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string StorageId { get; set; }

        [SugarColumn(IsIgnore = true)]
        public List<SingleBox> Box { get; set;}

        /// <summary>
        /// 目标点
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string Target { get; set; }

        /// <summary>
        /// 库位外键
        /// </summary>
        [Navigate(NavigateType.OneToMany, nameof(StorageId))]
        public WareHouse WareHouse { get; set; }
        /// <summary>
        /// 是否在库
        /// </summary>
        public bool House { get; set; } = false;

        /// <summary>
        /// 产线
        /// </summary>
        public string Productionline { get; set; }

        /// <summary>
        /// 单箱最早的生产日期
        /// </summary>
        public string EarliestBoxTime { get; set; }

        /// <summary>
        /// 库龄(天)
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string StockAgeDays { get; set; }

    }

}
